<?php
namespace app\baseinfo\controller;

class Groups extends \app\common\controller\Base {
	protected $modelname='Group';

	protected function _index(){
		$condition=[];
    $param = $this->param;

    if (isset($param['name']))
      $condition[]=['name','like',"%".$param['name']."%"];

    // if (isset($param['customer_type']))
    //   $condition[]=['customer_type','like',"%".$param['customer_type']."%"];

    if (isset($param['submitter_time']))
      $condition[]=['submitter_time','between',$param['submitter_time']];

    if (isset($param['submitter']))
      $condition[]=['submitter_id',"in",model('admin/AdminUser')->where('real_name','like','%'.$param['submitter'].'%')->column('id')];

    if (isset($param['remark']))
      $condition[]=['remark','like',"%".$param['remark']."%"];

		return $condition;
	}
}

?>